import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],

  resolve: {
    alias: [
      {
        find: '@',
        replacement: '/src',
      },
    ],
  },

  server: {
    cors: true,
    proxy: {
      '/api': {
        // target: 'http://122.51.11.240:8787',
        target: 'http://43.143.34.175:8787',
        changeOrigin: true,
        ws: true,
        rewrite: path => path.replace(/^\/api/, ''),
      },
    },
  },
})
